struct ListNode* reverseBetween(struct ListNode* head, int left, int right) {
    if (NULL == head || NULL == head->next) {
        return head;
    }
    struct ListNode *dumbNode = (struct ListNode*)malloc(sizeof(struct ListNode));
    dumbNode->val = -1;
    dumbNode->next = head;
    struct ListNode *cur = dumbNode;
    struct ListNode *pre = dumbNode; 
    struct ListNode *next = NULL; 
    int i = 0;
    for (i = 0; i < left - 1; i++) {
        pre = pre->next;
    }
    cur = pre->next;
    next = cur->next;
    for (i = 0; i < right - left; i++) {
        next = cur->next;
        cur->next = next->next;
        next->next = pre->next;
        pre->next = next;
    }
    return dumbNode->next;
}